//
// Created by wenyiyu on 2024/7/6.
//

#include <QApplication>

#include "applet.h"
#include "util/tool.h"
#include "log.h"

static void setupSettingDomain() {
    QCoreApplication::setOrganizationName(NetFileTransfer::getBrand());
    //    QCoreApplication::setOrganizationDomain("example.com");
    QCoreApplication::setApplicationName(NetFileTransfer::getBrand());
}

static void setupHighDpiScaling() {
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) &&  QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
    QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
    QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
}

int main(int argc, char* argv[]) {
    setupSettingDomain();
    setupHighDpiScaling();
    QApplication app(argc, argv);
    auto font = app.font();
    font.setPixelSize(16);
    app.setFont(font);
    initLog();
    Applet w;
    w.show();
    return app.exec();
}
